package com.sxyjhh.service.data_exchange;

import com.sxyjhh.create.api.DataApi;
import com.sxyjhh.dbutil.basic.ConstConfig;
import com.sxyjhh.dbutil.basic.DBQueryUtils;
import com.sxyjhh.dbutil.utils.DBInfoUtil;
import com.sxyjhh.schedule.TaskRunnable;

/**
 * Created by Administrator on 2018/6/25.
 */
public class ImageRunnable extends TaskRunnable {

    private ImageService imageService;
    private String tabName;
    private String key;
    private DataApi ri;

    public ImageRunnable(ImageService imageService,
                         String tabName, String key, DataApi ri) {
        this.taskId = "images-" + tabName;
        this.imageService = imageService;
        this.key = key;
        this.tabName = tabName;
        this.ri = ri;
    }


    @Override
    public void run() {
        ConstConfig.DBType dbType = ConstConfig.DBType.valueOf(Integer.valueOf("3"));
        DBQueryUtils dbQueryUtils = new DBQueryUtils(DBInfoUtil.getDBDriverName(dbType),
                "jdbc:mysql://192.168.2.201:3306/test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useInformationSchema=true&useSSL=false",
                "root", "Yun123456789/", 1);

        imageService.getImageInfo(tabName, tabName, ri, key, 0);
    }

}
